﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.UI;

namespace YUIAspNet
{
    /// <summary>
    /// Represents a group inside a menu
    /// </summary>
    [ParseChildren(true)]
    [Serializable]
    [ToolboxItem(false)]
    public class MenuGroup
    {
        private IList<MenuItem> _menuItems;
        /// <summary>
        /// Get or set the display text/html
        /// </summary>
        public string Text { get; set; }

        /// <summary>
        /// Sub-menu items.
        /// </summary>
        [
            Category("Data"),
            Description("Button options."),
            PersistenceMode(PersistenceMode.InnerProperty)
        ]
        public IList<MenuItem> MenuItems 
        {
            get
            {
                if(_menuItems == null)
                    _menuItems = new List<MenuItem>();

                return _menuItems;
            }
        }
    }
}
